#include <stdio.h>
# include <math.h>
int main()
{
int N,X,Y,CNT;
scanf("%d",&N);
for(X=1;X<=sqrt(N);X++){
	for(Y=1;Y<=sqrt(N);Y++){
		if(X*X+Y*Y==N&&X<=Y){
		printf("%d %d\n",X,Y);
		++CNT;
		}
	}
}
		if(CNT==0){
		printf("No Solution\n");
		}
    return 0;
}


